<?php
/**
 * Created by PhpStorm.
 * User: Allen
 * Date: 2016/10/9
 * Time: 17:31
 */
class TestApi extends TestCase
{

    protected $_repoService;
    protected $_user;

    public function testStore() {
        $this->actingAs($this->_user);
        $data = [
            'name' => "allen4",
            'mobile' => '111',
        ];
        $response = $this->call('POST', '/v1/customer', $data);
        dump($response->getContent());
    }

    public function testApiAccept(){
        $this->actingAs($this->_user);
        $data = [
            'customer_id' => '580349bd3211362256240775',
        ];
        $response = $this->call('POST','/accept', $data);
        dump($response->getContent());
    }

    public function testQrcode() {
        //$this->actingAs($this->_user);
        $response = $this->call('GET', '/qrcode/57ecf55428ac5187f24f3d05');
        dump($response->getContent());
    }

    public function testInit() {
        $this->actingAs($this->_user);
        $response = $this->call('GET', '/init');
        dump($response->getContent());
    }

    protected function setUp()
    {
        parent::setUp();
        //$this->_repoService = new \App\Services\Repo\CustomerRepo();

        //$this->_user = \App\Models\User::where('name', 'mi')->first();
        $this->_user = \App\Models\User::where('mobile', '17051217272')->first();

        //$this->_user = \App\Models\User::where('email', 'shangxian01@163.com')->first();
    }

    protected function tearDown()
    {
        parent::tearDown();
    }
}
